package cn.zyq.baking.service.impl;

import cn.zyq.baking.mapper.BannerMapper;
import cn.zyq.baking.pojo.vo.BannerAdminVO;
import cn.zyq.baking.pojo.vo.BannerVO;
import cn.zyq.baking.service.IBannerService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class BannerServiceImpl implements IBannerService {

    @Autowired
    BannerMapper bannerMapper;

    public List<BannerVO> listForIndex() {
        List<BannerVO> list=bannerMapper.selectForIndex();
        for(BannerVO b:list){
            System.out.println(b);
        }
        return bannerMapper.selectForIndex();
    }

    public List<BannerAdminVO> listForAdmin() {
        return bannerMapper.selectForAdmin();
    }

    public void deleteById(Long id) {
        bannerMapper.deleteById(id);
    }
}
